package com.fqgj.sentry.controller.mc;

import com.fqgj.sentry.biz.mc.LogBusiness;
import com.fqgj.sentry.common.annotations.ParamsValidate;
import com.fqgj.sentry.common.cache.RequestLocalInfo;
import com.fqgj.sentry.common.response.ApiOutput;
import com.fqgj.sentry.common.utils.ApiPage;
import com.fqgj.sentry.controller.mc.request.LogPageVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * Created by ykpbean kangping.ying@yuntu-inc.com
 *
 * @description
 * @create 2017-07-19 上午9:23
 */

@RestController
@RequestMapping("/log")
public class LogController {
    @Autowired
    private LogBusiness logBusiness;

    @ParamsValidate
    @RequestMapping(value = "/list", method = RequestMethod.POST)
    public ApiOutput queryLogList(@RequestBody LogPageVo logPageVo) {
        ApiPage apiPage = logBusiness.queryLogListForPage(RequestLocalInfo.getCurrentUserId(), logPageVo.getEmail(), logPageVo.getPageNum(), logPageVo.getPageSize());
        return new ApiOutput<>(apiPage);
    }

}
